<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>内置对象Array</title>
    
</head>
<body>
    <script type="text/javascript">
        // 字面量创建
         var arr = [1, 2, 3];
        //  内置对象 native object对象: 属性和方法
        // alert(typeof arr) object

        // js提供构造函数
        var colors = new Array;
        if (Array.isArray(colors)) {
            colors[0] = 'red';
            colors[1] = 'blue';
            colors[2] = 'green';
            console.log(colors.length);
            console.log(colors);
            console.log(colors.toString());
        }
    </script>
</body>
</html>